package com.surenpi.jenkins.client.job;

import com.surenpi.jenkins.client.BaseModel;
import com.surenpi.jenkins.client.core.Action;
import com.surenpi.jenkins.client.core.Artifact;
import com.surenpi.jenkins.client.core.BuildResult;
import com.surenpi.jenkins.client.scm.ScmChangeInfo;
import java.util.List;

public class BuildDetail extends BaseModel {
   private List<Action> actions;
   private List<Artifact> artifacts;
   private boolean building;
   private String description;
   private String displayName;
   private long duration;
   private long estimatedDuration;
   private String fullDisplayName;
   private String id;
   private boolean keepLog;
   private int number;
   private int queueId;
   private BuildResult result;
   private long timestamp;
   private String url;
   private List<ScmChangeInfo> changeSets;
   private BuildInfo nextBuild;
   private BuildInfo previousBuild;

   public List<Action> getActions() {
      return this.actions;
   }

   public List<Artifact> getArtifacts() {
      return this.artifacts;
   }

   public boolean isBuilding() {
      return this.building;
   }

   public String getDescription() {
      return this.description;
   }

   public String getDisplayName() {
      return this.displayName;
   }

   public long getDuration() {
      return this.duration;
   }

   public long getEstimatedDuration() {
      return this.estimatedDuration;
   }

   public String getFullDisplayName() {
      return this.fullDisplayName;
   }

   public String getId() {
      return this.id;
   }

   public boolean isKeepLog() {
      return this.keepLog;
   }

   public int getNumber() {
      return this.number;
   }

   public int getQueueId() {
      return this.queueId;
   }

   public BuildResult getResult() {
      return this.result;
   }

   public long getTimestamp() {
      return this.timestamp;
   }

   public String getUrl() {
      return this.url;
   }

   public List<ScmChangeInfo> getChangeSets() {
      return this.changeSets;
   }

   public BuildInfo getNextBuild() {
      return this.nextBuild;
   }

   public BuildInfo getPreviousBuild() {
      return this.previousBuild;
   }

   public void setActions(final List<Action> actions) {
      this.actions = actions;
   }

   public void setArtifacts(final List<Artifact> artifacts) {
      this.artifacts = artifacts;
   }

   public void setBuilding(final boolean building) {
      this.building = building;
   }

   public void setDescription(final String description) {
      this.description = description;
   }

   public void setDisplayName(final String displayName) {
      this.displayName = displayName;
   }

   public void setDuration(final long duration) {
      this.duration = duration;
   }

   public void setEstimatedDuration(final long estimatedDuration) {
      this.estimatedDuration = estimatedDuration;
   }

   public void setFullDisplayName(final String fullDisplayName) {
      this.fullDisplayName = fullDisplayName;
   }

   public void setId(final String id) {
      this.id = id;
   }

   public void setKeepLog(final boolean keepLog) {
      this.keepLog = keepLog;
   }

   public void setNumber(final int number) {
      this.number = number;
   }

   public void setQueueId(final int queueId) {
      this.queueId = queueId;
   }

   public void setResult(final BuildResult result) {
      this.result = result;
   }

   public void setTimestamp(final long timestamp) {
      this.timestamp = timestamp;
   }

   public void setUrl(final String url) {
      this.url = url;
   }

   public void setChangeSets(final List<ScmChangeInfo> changeSets) {
      this.changeSets = changeSets;
   }

   public void setNextBuild(final BuildInfo nextBuild) {
      this.nextBuild = nextBuild;
   }

   public void setPreviousBuild(final BuildInfo previousBuild) {
      this.previousBuild = previousBuild;
   }

   public boolean equals(final Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof BuildDetail)) {
         return false;
      } else {
         BuildDetail other = (BuildDetail)o;
         if (!other.canEqual(this)) {
            return false;
         } else {
            Object this$actions = this.getActions();
            Object other$actions = other.getActions();
            if (this$actions == null) {
               if (other$actions != null) {
                  return false;
               }
            } else if (!this$actions.equals(other$actions)) {
               return false;
            }

            Object this$artifacts = this.getArtifacts();
            Object other$artifacts = other.getArtifacts();
            if (this$artifacts == null) {
               if (other$artifacts != null) {
                  return false;
               }
            } else if (!this$artifacts.equals(other$artifacts)) {
               return false;
            }

            if (this.isBuilding() != other.isBuilding()) {
               return false;
            } else {
               Object this$description = this.getDescription();
               Object other$description = other.getDescription();
               if (this$description == null) {
                  if (other$description != null) {
                     return false;
                  }
               } else if (!this$description.equals(other$description)) {
                  return false;
               }

               Object this$displayName = this.getDisplayName();
               Object other$displayName = other.getDisplayName();
               if (this$displayName == null) {
                  if (other$displayName != null) {
                     return false;
                  }
               } else if (!this$displayName.equals(other$displayName)) {
                  return false;
               }

               if (this.getDuration() != other.getDuration()) {
                  return false;
               } else if (this.getEstimatedDuration() != other.getEstimatedDuration()) {
                  return false;
               } else {
                  Object this$fullDisplayName = this.getFullDisplayName();
                  Object other$fullDisplayName = other.getFullDisplayName();
                  if (this$fullDisplayName == null) {
                     if (other$fullDisplayName != null) {
                        return false;
                     }
                  } else if (!this$fullDisplayName.equals(other$fullDisplayName)) {
                     return false;
                  }

                  Object this$id = this.getId();
                  Object other$id = other.getId();
                  if (this$id == null) {
                     if (other$id != null) {
                        return false;
                     }
                  } else if (!this$id.equals(other$id)) {
                     return false;
                  }

                  if (this.isKeepLog() != other.isKeepLog()) {
                     return false;
                  } else if (this.getNumber() != other.getNumber()) {
                     return false;
                  } else if (this.getQueueId() != other.getQueueId()) {
                     return false;
                  } else {
                     Object this$result = this.getResult();
                     Object other$result = other.getResult();
                     if (this$result == null) {
                        if (other$result != null) {
                           return false;
                        }
                     } else if (!this$result.equals(other$result)) {
                        return false;
                     }

                     if (this.getTimestamp() != other.getTimestamp()) {
                        return false;
                     } else {
                        Object this$url = this.getUrl();
                        Object other$url = other.getUrl();
                        if (this$url == null) {
                           if (other$url != null) {
                              return false;
                           }
                        } else if (!this$url.equals(other$url)) {
                           return false;
                        }

                        Object this$changeSets = this.getChangeSets();
                        Object other$changeSets = other.getChangeSets();
                        if (this$changeSets == null) {
                           if (other$changeSets != null) {
                              return false;
                           }
                        } else if (!this$changeSets.equals(other$changeSets)) {
                           return false;
                        }

                        Object this$nextBuild = this.getNextBuild();
                        Object other$nextBuild = other.getNextBuild();
                        if (this$nextBuild == null) {
                           if (other$nextBuild != null) {
                              return false;
                           }
                        } else if (!this$nextBuild.equals(other$nextBuild)) {
                           return false;
                        }

                        Object this$previousBuild = this.getPreviousBuild();
                        Object other$previousBuild = other.getPreviousBuild();
                        if (this$previousBuild == null) {
                           if (other$previousBuild != null) {
                              return false;
                           }
                        } else if (!this$previousBuild.equals(other$previousBuild)) {
                           return false;
                        }

                        return true;
                     }
                  }
               }
            }
         }
      }
   }

   protected boolean canEqual(final Object other) {
      return other instanceof BuildDetail;
   }

   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $actions = this.getActions();
      result = result * 59 + ($actions == null ? 43 : $actions.hashCode());
      Object $artifacts = this.getArtifacts();
      result = result * 59 + ($artifacts == null ? 43 : $artifacts.hashCode());
      result = result * 59 + (this.isBuilding() ? 79 : 97);
      Object $description = this.getDescription();
      result = result * 59 + ($description == null ? 43 : $description.hashCode());
      Object $displayName = this.getDisplayName();
      result = result * 59 + ($displayName == null ? 43 : $displayName.hashCode());
      long $duration = this.getDuration();
      result = result * 59 + (int)($duration >>> 32 ^ $duration);
      long $estimatedDuration = this.getEstimatedDuration();
      result = result * 59 + (int)($estimatedDuration >>> 32 ^ $estimatedDuration);
      Object $fullDisplayName = this.getFullDisplayName();
      result = result * 59 + ($fullDisplayName == null ? 43 : $fullDisplayName.hashCode());
      Object $id = this.getId();
      result = result * 59 + ($id == null ? 43 : $id.hashCode());
      result = result * 59 + (this.isKeepLog() ? 79 : 97);
      result = result * 59 + this.getNumber();
      result = result * 59 + this.getQueueId();
      Object $result = this.getResult();
      result = result * 59 + ($result == null ? 43 : $result.hashCode());
      long $timestamp = this.getTimestamp();
      result = result * 59 + (int)($timestamp >>> 32 ^ $timestamp);
      Object $url = this.getUrl();
      result = result * 59 + ($url == null ? 43 : $url.hashCode());
      Object $changeSets = this.getChangeSets();
      result = result * 59 + ($changeSets == null ? 43 : $changeSets.hashCode());
      Object $nextBuild = this.getNextBuild();
      result = result * 59 + ($nextBuild == null ? 43 : $nextBuild.hashCode());
      Object $previousBuild = this.getPreviousBuild();
      result = result * 59 + ($previousBuild == null ? 43 : $previousBuild.hashCode());
      return result;
   }

   public String toString() {
      return "BuildDetail(actions=" + this.getActions() + ", artifacts=" + this.getArtifacts() + ", building=" + this.isBuilding() + ", description=" + this.getDescription() + ", displayName=" + this.getDisplayName() + ", duration=" + this.getDuration() + ", estimatedDuration=" + this.getEstimatedDuration() + ", fullDisplayName=" + this.getFullDisplayName() + ", id=" + this.getId() + ", keepLog=" + this.isKeepLog() + ", number=" + this.getNumber() + ", queueId=" + this.getQueueId() + ", result=" + this.getResult() + ", timestamp=" + this.getTimestamp() + ", url=" + this.getUrl() + ", changeSets=" + this.getChangeSets() + ", nextBuild=" + this.getNextBuild() + ", previousBuild=" + this.getPreviousBuild() + ")";
   }
}
